<template>
  <div id="history">
    <div class="block">
        <div class="title">历史搜索</div>
        <div class="list">
            <span @click="del(index) " v-for="(item,index) in historylist" :key="index"> {{item}} </span>
        </div>
    </div>
  </div>
</template>

<script>
import { mapMutations, mapState } from 'vuex'
export default {
    computed:{
        ...mapState('history',['historylist'])
    },
    methods:{
        ...mapMutations('history',['del'])
    }
}
</script>

<style>
    #history .block{
        margin: 10px;
    }
    #history .block .title{
        font-weight: bold;
        padding: 10px 0;
    }
    #history .block .list span{
        display: inline-block;
        background-color: #f5f5f5;
        padding: 5px 10px;
        border-radius: 5px;
        margin-right: 10px;
        margin-bottom: 10px;

    }
</style>